/**
 * ============================================================
 * 版权：Autohome 版权所有 (c) 2014 - 2015
 * 文件：com.athm.framework.dao.PageResults.java
 * 所含类: PageResults.java
 * 修改记录：
 * 日期 作者 内容
 * =============================================================
 * 2011-12-12 zhangyongxin 分页组件类
 * ============================================================
 */
package com.quanyou.base.framework.dao.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * <p> PageResults </p>
 * 
 * <p> DAO层分页组件类 </p>
 * 
 * <p> Copyright: 版权所有 (c) 2014 - 2015 </p>
 * <p> Company:Autohome </p>
 * 
 * @author zhangyongxin
 * @version 1.0
 * 
 */

public class PageResults<E> implements Serializable {
	
	private static final long serialVersionUID = -6387086497638925166L;
	
	/** 当前页数据结果集 */
	private List<E> results = new ArrayList<E>();
	
	/** 总数 */
	private long totalCount = 0;
	
	private PageParams<E> params;
	
	public List<E> getResults() {
		return results;
	}
	
	public void setResults(List<E> results) {
		this.results = results;
	}
	
	public PageParams<E> getParams() {
		return params;
	}
	
	public void setParams(PageParams<E> params) {
		this.params = params;
	}
	
	public long getPageCount() {
		return (this.totalCount + params.getPageSize() - 1) / params.getPageSize();
	}
	
	public long getTotalCount() {
		return totalCount;
	}
	
	public void setTotalCount(long totalCount) {
		this.totalCount = totalCount;
	}
}
